package hmy.com;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AnimalConfig {

    @Bean
    public Dog dog(){
        Dog dog = new Dog();
        dog.setName("小狗");
        return dog;
    }

    @Bean
    public Cat cat(){
        Cat cat = new Cat();
        cat.setName("小猫");
        return cat;
    }

}
